<html>
<head>
<title>Talk Nerdy</title>
<link rel="stylesheet" type="text/css" href="/lib/custom-form-elements.css"/>
<script src="/lib/custom-form-elements.js"></script>

<link rel="stylesheet" type="text/css" href="/templates/notebook.css"/>
<link rel="stylesheet" type="text/css" href="/templates/research.css"/>
<style type="text/css">
ul.navbar
{
border:1px;
border-style:solid;
width:160;
list-style-type:none;
margin:0;
padding:0;
}
ul.navbar a:link, ul.navbar a:visited
{
display:block;
font-family:times;
font-weight: bold;
font-variant: small-caps;
color:#FFFFFF;
background-color:#98bf21;
width:150px;
text-align:center;
padding:4px;
border:1px solid #98bf21;
text-decoration:none;
}
ul.navbar a:hover, ul.navbar a:active
{
background-color:#7A991A;
}
ul.navbar a:link[title=highlight]
{
border:1px solid white;
background-color: #a8df49;
}
#document_area
{
width: 100%;
}
#document_area h1
{
font-size: 12pt;
font-style: italic;
}
#header img
{
vertical-align: middle;
}
#header {
background: #E0E0E0;
border-bottom: 2px solid black;
font-family: serif;
font-style: italic;
}
</style>

<link type="text/css" href="/lib/jqueryui/css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />

<script src="/lib/jquery.min.js"></script>
<script src="/lib/jquery.cookie.js"></script>
<script src="/lib/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script>
<script src="/lib/overlib/overlib.js"></script>
<script src="/lib/webtoolkit.base64.js"></script>
<script src="/templates/ajax_standalone.js"></script>
<script src="/templates/notebook.js"></script>
<script src="/templates/research.js"></script>

<script type="text/javascript">
function nav_tab(id)
{
    $(".navbar").find("a").attr("title", "");
    $("#" + id).attr("title", "highlight");
}

function favorites()
{
    nav_tab("fav");
	notebook_load($("#document_area"), "__user__:Favorites", true);
	window.location = "#fav";
}
function notebooks()
{
    nav_tab("nbooks");
	$("#document_area").load("/notebooks", "", function() {
		$("#document_area").find("li").each(function() {
			var nbid = $(this).text();
			var a = $("<a/>");
			a.attr('href', "#nbooks?" + nbid);
			a.click(function() { notebook(nbid); });
			a.text(nbid);
			$(this).html(a);
		});
	});
	window.location = "#nbooks";
}
function notebook(nbid)
{
    nav_tab("nbooks");
	notebook_load($("#document_area"), nbid, true); 
}
function research()
{
    nav_tab("research");
	$('#document_area').load("/templates/compose.html", "", research_begin);
    window.location = "#research";
}

$(function() { 
    if (document.location.hash == "#fav") 
        setTimeout(favorites, 0); 
    if (document.location.hash == "#nbooks")
        setTimeout(notebooks, 0); 
    if (document.location.hash == "#research")
        setTimeout(research, 0); 
		
	var expr1 = document.location.hash.match("#nbooks\\?(.*)");
    if (expr1 != null) {
        setTimeout(function() {
			notebook(expr1[1]); 
		}, 0);
	}

	var expr2 = document.location.hash.match("#research\\?(.*)");
    if (expr2 != null) {
        setTimeout(function() { nav_tab("research"); 
            research_form(expr2[1]); },
         10);
    }
});
</script>

</head>
<body>
<div class="main">
<h1 id="header"><img src="/px/sean/talking.png"/>$ Talk Nerdy to Me...</h1>
<b>__user__</b> <a href="__login__">log in</a>

<table><tr><td style="vertical-align:top">

<ul class="navbar">
<li><a id="fav" href="javascript:favorites()">My Favorites</a></li>
<li><a id="nbooks" href="javascript:notebooks()">Notebooks</a></li>
<li><a id="research" href="javascript:research()">Research</a></li>
</ul>

</td><td>

<div id="document_area"></div>

</td></tr></table>

</div>
</body>